package com.gitee.wsl.struct.grammar.ast.node

interface NodeType{
    val name: String
    val isToken: Boolean get() = false

    companion object{
        val UNDEFAULTER  = NodeType("UNDEFAULTER")


        val PARAGRAPH  = NodeType("PARAGRAPH", true)


        val EOL = NodeType("EOL", true)

        val BLOCK_QUOTE = NodeType("BLOCK_QUOTE", true)

        val ATX_1 = NodeType("ATX_1")

        val ATX_2 = NodeType("ATX_2")

        val ATX_3 = NodeType("ATX_3")

        val ATX_4 = NodeType("ATX_4")

        val ATX_5 = NodeType("ATX_5")

        val ATX_6 = NodeType("ATX_6")
    }
}

fun NodeType(name: String, isToken: Boolean = false): NodeType =NodeTypeImp(name, isToken)

open class NodeTypeImp(override val name: String, override val isToken: Boolean = false):  NodeType {

    override fun toString(): String {
        return name
    }
}